const stripSymbolObservableMethodPlugin = ({ types: t }) => {
    const isSymbolObservable = t.buildMatchMemberExpression('Symbol.observable');
    return {
        visitor: {
            Class(path) {
                path
                    .get('body.body')
                    .filter(
                        (p) => p.isClassMethod() && isSymbolObservable(p.get('key').node)
                    )
                    .forEach((p) => p.remove());
            }
        }
    };
};

module.exports = {
    assumptions: {
        constantReexports: true, // only matters for tests (since only there we transpile to CJS using Babel), it makes debugging easier
        setClassMethods: true,
        setComputedProperties: true,
        setPublicClassFields: true,
        setSpreadProperties: true
    },
    presets: [
        [
            '@babel/preset-env',
            {
                targets: "ie 11"
            }
        ],
        [
            '@babel/preset-typescript',
            { isTSX: true, allExtensions: true, disallowAmbiguousJSXLike: true }
        ]
    ],
    plugins: [
        "@babel/plugin-proposal-class-properties"
    ]
};
